export function mapMouseMove() {
  this.map.on("pointermove", (e) => {
    const locateDiv = document.querySelector("#locateDiv") || document.createElement("div");
    locateDiv.id = "locateDiv";
    locateDiv.style.position = "absolute";
    locateDiv.style.background = "#fff";
    locateDiv.style.border = "1px solid #000";
    locateDiv.style.pointerEvents = "none";
    document.body.appendChild(locateDiv);
    let width = locateDiv.getBoundingClientRect().width;
    let height = locateDiv.getBoundingClientRect().height;
    locateDiv.innerHTML = e.coordinate[0].toFixed(2) + "," + e.coordinate[1].toFixed(2);
    locateDiv.style.top = e.originalEvent.y - height + "px";
    locateDiv.style.left = e.originalEvent.x - width + "px";
  });

  return function mousemove(e) {
    const locateDiv = document.querySelector("#locateDiv");
    if (e.srcElement.tagName !== "CANVAS" && locateDiv) {
      document.body.removeChild(locateDiv);
    }
  };
}
